


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 * Handles requests for the application home page.
 */
@Controller
public class HomeController {
	
	
	@RequestMapping(value = "/", method = RequestMethod.GET)
	public ModelAndView CarregarHome() {
		
		ModelAndView home = new ModelAndView("home");
		br.com.ecommerce.entidade.Usuario usuario = new br.com.ecommerce.entidade.Usuario();
		usuario.setCodigo(1l);
		usuario.setNome("windson");
		usuario.setSenha("123");
		home.addObject("usuario",usuario);
		
		return home ;
		
		
		
	}
	
	@RequestMapping(value = "/home", method = RequestMethod.GET)
	public ModelAndView CarregarHomeInterno() {
		
		ModelAndView home = new ModelAndView("home");
		br.com.ecommerce.entidade.Usuario usuario = new br.com.ecommerce.entidade.Usuario();
		usuario.setNome("jjj");

		home.addObject("usuario",usuario);
		
		return home ;
	
}
}
